import {DeleteByRes, QueryParams, QueryRes, SaveParams, SaveRes} from "@/api/daily/train/type.ts";
import request from "@/utils/request.ts";

/**
 * deleteById
 * @param {string} id
 * @returns
 */
export function deleteById(id: number): Promise<DeleteByRes> {
    return request.delete(`/business/admin/dailyTrain/delete/${id}`);
}

/**
 * query_5
 * @param {object} params DailyTrainQueryReq
 * @param {number} params.pageNum
 * @param {number} params.pageSize
 * @returns
 */
export function query(params: QueryParams): Promise<QueryRes> {
    return request.post(`/business/admin/dailyTrain/quest-list`, params);
}

/**
 * save_5
 * @param {object} params DailyTrainSaveReq
 * @param {number} params.id
 * @param {object} params.date
 * @param {string} params.code
 * @param {string} params.type
 * @param {string} params.start
 * @param {string} params.startPinyin
 * @param {object} params.startTime
 * @param {string} params.end
 * @param {string} params.endPinyin
 * @param {object} params.endTime
 * @param {object} params.createTime
 * @param {object} params.updateTime
 * @returns
 */
export function save(params: SaveParams): Promise<SaveRes> {
    return request.post(`/business/admin/dailyTrain/save`, params);
}